<template>
  <div class="small-dialog ac-window-center-min">
    <div class="small-dialog-header">
      <div class="small-dialog-title">{{ title }}</div>
      <div class="small-dialog-close ac-btn-close" @click="handleClose"></div>
    </div>
    <div class="small-dialog-body">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import { defineComponent } from "vue";

import { UI, WINDOW_TYPE } from "@/cim";

export default defineComponent({
  name: "SmallDialog",
  props: {
    title: {
      type: String,
      default: "",
    },
  },
  methods: {
    handleClose() {
      UI.HideWindow(WINDOW_TYPE.CENTER_MIN_WINDOW);
    },
  },
});
</script>

<style lang="scss" scoped>
.small-dialog {
  width: 360px;
  height: 260px;
  overflow: hidden;

  &-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 16px;
  }

  &-title {
    margin-left: 36px;
    color: #fff;
    font-size: 16px;
    font-family: cn;
  }

  &-close {
    cursor: pointer;
  }

  &-body {
    height: calc(100% - 38px);
    padding: 8px 8px 16px;
    overflow: hidden;
    color: #fff;
  }
}
</style>
